/**
 * Created by Administrator on 2017/3/21.
 */
import React, { Component } from 'react';
import {
  Form, Input, Radio, Select, Icon,
  Upload,
} from 'antd';
import { connect } from 'dva';
import moment from 'moment';
import request from '@/utils/request';

const FormItem = Form.Item;
const { TextArea } = Input;
const RadioGroup = Radio.Group;
const Option = Select.Option;

class AddPoliciesForm extends Component {
  constructor(props) {
    super(props);
    this.state = {
      fileList: [],
    };
  }

  componentDidMount() {
  }

  render() {
    const formItemLayoutWithLabel = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 7 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 17 },
      },
    };
    const formItemLayoutWithLabel2 = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 2 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 22 },
      },
    };
    const { getFieldDecorator } = this.props.form;
    const props = {
      onRemove: (file) => {
        this.setState(({ fileList }) => {
          const index = fileList.indexOf(file);
          const newFileList = fileList.slice();
          newFileList.splice(index, 1);
          return {
            fileList: newFileList,
          };
        });
      },
      beforeUpload: (file) => {
        this.setState(({ fileList }) => ({
          fileList: [file],
        }));
        return false;
      },
      fileList: this.state.fileList,
    };
    return (
      <div>
        <Form onSubmit={this.handleSubmit}>
          <FormItem
            {...formItemLayoutWithLabel}
            style={{ width: '33%', display: 'inline-block' }}
            label={(
              <span>
               原仓库区域
            </span>
            )}
          >
            {getFieldDecorator('project_name', {
              initialValue: '下拉选择',
            })(
              <Input/>,
            )}
          </FormItem>
          <FormItem
            {...formItemLayoutWithLabel}
            style={{ width: '33%', display: 'inline-block' }}
            label={(
              <span>
               库存材料
            </span>
            )}
          >
            {getFieldDecorator('project_name', {
              initialValue: '下拉选择',
            })(
              <Input/>,
            )}
          </FormItem>
          <FormItem
            {...formItemLayoutWithLabel}
            style={{ width: '33%', display: 'inline-block' }}
            label={(
              <span>
               库存数量
            </span>
            )}
          >
            {getFieldDecorator('project_name', {
              initialValue: '自动填充',
            })(
              <Input/>,
            )}
          </FormItem>
          <FormItem
            {...formItemLayoutWithLabel}
            style={{ width: '33%', display: 'inline-block' }}
            label={(
              <span>
               新仓库区域
            </span>
            )}
          >
            {getFieldDecorator('project_name', {
              initialValue: '下拉选择',
            })(
              <Input/>,
            )}
          </FormItem>
          <FormItem
            style={{ width: '33%', display: 'inline-block' }}
            {...formItemLayoutWithLabel}
            label={(
              <span>
               调仓数量
            </span>
            )}
          >
            {getFieldDecorator('project_name', {
              initialValue: '',
            })(
              <Input/>,
            )}
          </FormItem>
          <FormItem
            style={{ width: '33%', display: 'inline-block' }}
            {...formItemLayoutWithLabel}
            label={(
              <span>
               调仓主题
            </span>
            )}
          >
            {getFieldDecorator('project_name', {
              initialValue: '',
            })(
              <Input/>,
            )}
          </FormItem>
          <FormItem
            style={{ width: '33%', display: 'inline-block' }}
            {...formItemLayoutWithLabel}
            label={(
              <span>
               备注
            </span>
            )}
          >
            {getFieldDecorator('project_name', {
              initialValue: '',
            })(
              <Input/>,
            )}
          </FormItem>
        </Form>
      </div>
    );
  }
}

const AddPoliciesFormWrap = Form.create()(AddPoliciesForm);
export default connect()(AddPoliciesFormWrap);


